#!/usr/local/bin/perl 

# So, this is a skeleton, you can use any language, any process inside or whatever you want

# all scuderia need is : return the right values! However this works more like munin-plugins
#			so you can just print the right result.

# GROUP: 
#		First, you have to define a group.
#		this could be anything you like, lets say this is a webserver, so group will be WEB
#		or this machine is in the b17 rack, so the group will be b17 but it's NEED for ALL CHECK!

# HOSTNAME: 
#		I hope you don't need any explanation. but, it have to be identical for the same host
#		beware of typos :P

# CHECK name: 
#		you can name a check as you want, my first check will look for linux load so I will call
#		linux_load. 

# VALUE :
#		So as you might know, this want to be a high-res perf monitor. So we want numbers to store
#		and read back to display. highest number 99999.99. And NUMBER only.

# now all you have to do is to fulfill this variable like this:
my $group = 'vm_local';
my $host  = 'debvm';
my $check = 'linux_load';

open(STATUS, "cat /proc/loadavg 2>1 |") || die "can't open procfile! $!";
my $line = <STATUS>;
my @vals = split(/ /, $line);

# just like I told before
print "$group,$host,$check,$vals[0]\n";
# yeah I almost forget about the delimiter (,) what is a simple comma. thanks, don't forget :)
